cmake_minimum_required(VERSION 3.10)
project(sqlite3)

# 设置C标准
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)

# 添加编译优化选项
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")

# 包含当前目录作为头文件搜索路径
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

# 指定源文件
set(SOURCES
    shell.c
    sqlite3.c
)

# 创建可执行文件
add_executable(sqlite3 ${SOURCES})

# 链接所需的库
target_link_libraries(sqlite3
    pthread
    dl
    m
)
